classdef Track < handle
    
    properties
        % General variables
        name;
        fileName;
        volume;
        instrInd;
        instrSet; %Struct
        effect;
        effectInd;
        data;
        
        % Signal variables
        Fs;
        x;
        y;
    end
    
    methods
        
        function obj = Track(nameIn, fileNameIn, dataIn)
            obj.name = nameIn;
            obj.fileName = fileNameIn;
            obj.volume = 1;
            obj.instrInd = 1;
%             obj.instrSet = Instrument('default');
            obj.effect = {};
            obj.effectInd = 1;
            obj.data = dataIn;
            
            obj.refresh();
        end
        
        function refresh(obj)
            %Si es midi
            switch obj.instrInd
                case 1 % No Synthesis
                    [obj.y,obj.Fs] = midi2audio(obj.data);
                    obj.y = obj.y*0.95/max(abs(obj.y));
                    obj.x = linspace(0, length(obj.y)/obj.Fs, length(obj.y));
                case 2 % Acoustic Guitar
                    
                case 3 % Banjo
            end
                    
        end
        
    end
end
    
    